// specobj.txt - This very simple script waits until this object is searched. When it
// is, calls a given special node in the current town's script.

// Memory Cells - 
//   0 - Number of a state in the town script. This is the state that is called when the item is used.
//   1,2 - Coordinates for a stuff done flag. If these are 0 and 0, ignored. Otherwise,
//     is the given flag is zero, nothing happens when the object is used.

//EDITED BY SUPANIK - I wanted the party to know this was here AFTER a flag was set to 1, not before, so I just altered the ">" for an "==" in the SEARCH_STATE. 

beginterrainscript; 

variables;

body;

beginstate INIT_STATE;

	break;

beginstate START_STATE;
break;

beginstate SEARCH_STATE;
	if (get_flag(get_memory_cell(1),get_memory_cell(2)) == 0) {
		end();
	}
	
	run_town_script(get_memory_cell(0));

break;
